﻿using System.Web.Mvc;

namespace Higgs.Web.AtomPub.ActionResults
{
    public class UnauthorizedResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            var response = context.RequestContext.HttpContext.Response;

            response.StatusCode = 0x191;
            response.StatusDescription = "Unauthorized";
            response.AddHeader("WWW-Authenticate", "Basic realm=\"Atom Publishing\"");
            response.Write("Unauthorized");
            response.End();
        }
    }
}